// Http Request Define



#ifndef _HTTP_COMM_HTTP_REQUEST_CUSTORM_H_
#define _HTTP_COMM_HTTP_REQUEST_CUSTORM_H_

#include <stdint.h>
#include <string>
#include <iostream>
#include <map>



namespace comm
{
namespace http
{
namespace custorm
{
class CHttpRequest
{
  public:
    CHttpRequest(void);

  public:
    void SetMainUrl(const std::string& sUrl);
	std::string GetFullUrl(void) const;

    const void GetAllParameter(std::map<std::string, std::string>& mapHttpParameters) const;
    void SetParameter(const std::string& sName, const std::string& sValue);
	bool HasParameter() const;

    void AddHeader(const std::string& sName, const std::string& sValue);
    void GetAllHeaders(std::multimap<std::string, std::string>& mmapHttpHeaders) const;
    bool HasHeader() const;

    void SetTimeout(uint32_t dwTimeout);
    uint32_t GetTimeout(void) const;

    void EnableSSLVerify(void);
    void DisableSSLVerify(void);
    bool IsSSLVerifyEnabled(void) const;

    void EnableRedirect(void);
    void DisableRedirect(void);
    bool IsRedirectEnabled(void) const;
    void SetMaxRedirect(uint32_t dwMaxRedirect);
    uint32_t GetMaxRedirect(void) const;

  public:
    static const uint32_t DEFAULT_TIMEOUT = 3;
    static const uint32_t DEFAULT_MAX_REDIRECT = 3;

  private:
  	uint32_t m_dwTimeout;
	bool m_bSSLVerify;
    bool m_bRedirect;

    std::string m_sMainUrl;

    uint32_t m_dwMaxRedirect;
	
	std::map<std::string, std::string>      m_mapHttpParams;
	std::multimap<std::string, std::string> m_mmapHttpHeaders;
};

}
}
}

#endif // _HTTP_COMM_HTTP_REQUEST_CUSTORM_H_

